home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96a.txt
/
000065_icon-group-sender _Wed Mar 6 15:09:39 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1996-09-05
|
2KB
Received: by cheltenham.cs.arizona.edu; Wed, 6 Mar 1996 12:20:41 MST
From: "Hamish Lawson" <H.Lawson@tees.ac.uk>
Organization: University of Teesside (SCM)
To: icon-group@cs.arizona.edu
Date: Wed, 6 Mar 1996 15:09:39 GMT0BST
Subject: Re: Production of an operator's left-hand operand
Reply-To: H.Lawson@tees.ac.uk
Priority: normal
X-Mailer: Pegasus Mail for Windows (v2.0-WB2)
Message-Id: <1D200E66B9@scm_arkengarthdale.tees.ac.uk>
Errors-To: icon-group-errors@cs.arizona.edu
Status: O
I've been trying to make a case for a parallel set of operators that
that produce their left-hand side. The example I chose was of
printing the result of some expression only if a subsequent
expression succeeds. It's been pointed out that this can be achieved
thus:
write(1(e1,e2))
It's my own fault for choosing a poor example. Ken Walker did
concede that there is not an equivalent for comparison operators.
Let's choose a better (I hope!) example: say I want to print out
expression e1 only if its value is less than e2. The order of
evaluation may be important and so
write(e2 > e1)
may not be possible. We're forced to the rather inelegant alternative
write((e1 < (temp := e2), temp))
(The temp variable is necessary in the general case because a sceond
evaluation of e2 may produce a new value.)
Thus my proposal of an alternative set of operators that produce
their RH operands (I suggested prefixing the standard operators with
^); our expression then becomes
write(e1 ^< e2)
| Hamish Lawson, School of Computing and Mathematics,
| University of Teesside, Middlesbrough, Cleveland, UK, TS1 3BA
| Tel: +44 1642 218121 x3611 Fax: +44 1642 342604
| E-mail: H.Lawson@tees.ac.uk